(global.webpackJsonp = global.webpackJsonp || []).push([ [ "integral/address/editAddress" ], {
    "2cba": function(i, t, e) {},
    "4c29": function(i, t, e) {
        e.r(t);
        var n = e("ed54"), d = e("f669");
        for (var r in d) "default" !== r && function(i) {
            e.d(t, i, function() {
                return d[i];
            });
        }(r);
        e("86af");
        var s = e("f0c5"), o = Object(s.a)(d.default, n.b, n.c, !1, null, "b2d37620", null, !1, n.a, void 0);
        t.default = o.exports;
    },
    "86af": function(i, t, e) {
        var n = e("2cba");
        e.n(n).a;
    },
    ed54: function(i, t, e) {
        e.d(t, "b", function() {
            return n;
        }), e.d(t, "c", function() {
            return d;
        }), e.d(t, "a", function() {});
        var n = function() {
            this.$createElement;
            this._self._c;
        }, d = [];
    },
    f301: function(i, t, e) {
        (function(i) {
            e("1067"), n(e("66fd"));
            var t = n(e("4c29"));
            function n(i) {
                return i && i.__esModule ? i : {
                    default: i
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = e, i(t.default);
        }).call(this, e("543d").createPage);
    },
    f669: function(i, t, e) {
        e.r(t);
        var n = e("fa32"), d = e.n(n);
        for (var r in n) "default" !== r && function(i) {
            e.d(t, i, function() {
                return n[i];
            });
        }(r);
        t.default = d.a;
    },
    fa32: function(i, t, e) {
        (function(i) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var n = e("26cb"), d = e("a71e"), r = e("a71e"), s = e("8f9b");
            function o(i, t) {
                var e = Object.keys(i);
                if (Object.getOwnPropertySymbols) {
                    var n = Object.getOwnPropertySymbols(i);
                    t && (n = n.filter(function(t) {
                        return Object.getOwnPropertyDescriptor(i, t).enumerable;
                    })), e.push.apply(e, n);
                }
                return e;
            }
            function a(i, t, e) {
                return t in i ? Object.defineProperty(i, t, {
                    value: e,
                    enumerable: !0,
                    configurable: !0,
                    writable: !0
                }) : i[t] = e, i;
            }
            e("db8f");
            var u = {
                computed: function(i) {
                    for (var t = 1; t < arguments.length; t++) {
                        var e = null != arguments[t] ? arguments[t] : {};
                        t % 2 ? o(Object(e), !0).forEach(function(t) {
                            a(i, t, e[t]);
                        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(i, Object.getOwnPropertyDescriptors(e)) : o(Object(e)).forEach(function(t) {
                            Object.defineProperty(i, t, Object.getOwnPropertyDescriptor(e, t));
                        });
                    }
                    return i;
                }({}, (0, n.mapGetters)([ "mainColor", "user", "iphoneXStyle" ])),
                data: function() {
                    return {
                        multiArray: [ [], [], [] ],
                        info: {},
                        multiIndex: [ 0, 0, 0 ],
                        province_id: "",
                        city_id: "",
                        qu_id: "",
                        isedit: !1,
                        isConfirm: !1,
                        editAddInfo: {},
                        bgs: "",
                        listId: "",
                        btntxt: "保存",
                        isTouch: !1
                    };
                },
                created: function() {},
                onLoad: function(i) {
                    2 == i.type && (this.isedit = !0, this.listId = i.id, this.btntxt = "保存", this.getDetail());
                },
                onShow: function() {
                    this.getData();
                },
                methods: {
                    remind: function() {
                        this.bgs = !this.bgs;
                    },
                    getDetail: function() {
                        var i = this, t = {
                            id: this.listId
                        };
                        (0, s.addressInfo)(t).then(function(t) {
                            i.info = t, i.bgs = 1 == t.is_default, i.editAddInfo.editAdd = t.province + t.city + t.district, 
                            i.editAddInfo.province_id = t.province_id, i.editAddInfo.city_id = t.city_id, i.editAddInfo.district_id = t.district_id, 
                            i.editAddInfo.province = t.province, i.editAddInfo.city = t.city, i.editAddInfo.district = t.district;
                        });
                    },
                    getData: function() {
                        var i = this;
                        (0, s.districtList)({}).then(function(t) {
                            t.map(function(t, e) {
                                i.multiArray[0].push({
                                    value: t.id,
                                    id: t.id,
                                    name: t.name,
                                    city: t.city
                                });
                            }), t.map(function(t, e) {
                                0 === e && (i.multiArray[1] = [], t.city.map(function(t, e) {
                                    i.multiArray[1].push({
                                        id: t.id,
                                        name: t.name,
                                        parent_id: t.parent_id,
                                        district: t.district
                                    });
                                }));
                            }), i.multiArray[1][0].district.map(function(t, e) {
                                i.multiArray[2].push({
                                    id: t.id,
                                    name: t.name
                                });
                            });
                        });
                    },
                    save: function() {
                        var t = this;
                        if (t.isTouch) return !1;
                        if (t.isTouch = !0, (0, d.isEmpty)(t.info.name)) this.$toast("请输入姓名", "none"); else if ((0, 
                        d.isEmpty)(t.info.phone)) this.$toast("请输入手机号", "none"); else if ((0, d.isEmpty)(t.isedit) && (0, 
                        d.isEmpty)(t.isConfirm)) this.$toast("请选择省市区", "none"); else if ((0, r.isPhoneNumber)(t.info.phone)) if ((0, 
                        d.isEmpty)(this.info.detail)) this.$toast("请输入详细地址", "none"); else {
                            var e = {
                                id: this.listId,
                                name: this.info.name,
                                phone: this.info.phone,
                                province_id: this.isedit && !this.isConfirm ? this.editAddInfo.province_id : this.multiArray[0][this.multiIndex[0]].id,
                                province: this.isedit && !this.isConfirm ? this.editAddInfo.province : this.multiArray[0][this.multiIndex[0]].name,
                                city_id: this.isedit && !this.isConfirm ? this.editAddInfo.city_id : this.multiArray[1][this.multiIndex[1]].id,
                                city: this.isedit && !this.isConfirm ? this.editAddInfo.city : this.multiArray[1][this.multiIndex[1]].name,
                                district_id: this.isedit && !this.isConfirm ? this.editAddInfo.district_id : this.multiArray[2][this.multiIndex[2]].id,
                                district: this.isedit && !this.isConfirm ? this.editAddInfo.district : this.multiArray[2][this.multiIndex[2]].name,
                                detail: this.info.detail,
                                is_default: this.bgs ? 1 : 0
                            };
                            (0, s.addAddress)(e).then(function(e) {
                                t.$toast("保存成功", "none"), t.isTouch = !1, setTimeout(function() {
                                    i.navigateBack({});
                                }, 1e3);
                            });
                        } else this.$toast("手机号格式不正确", "none");
                    },
                    confirmAddress: function(i) {
                        this.multiIndex[0] = i.detail.value[0], this.multiIndex[1] = i.detail.value[1], 
                        this.multiIndex[2] = i.detail.value[2], this.isConfirm = !0, this.$forceUpdate();
                    },
                    bindMultiPickerColumnChange: function(i) {
                        0 == i.detail.column ? (this.multiIndex[0] = i.detail.value, this.getCity(i.detail.value)) : 1 == i.detail.column ? (this.multiIndex[1] = i.detail.value, 
                        this.getQu(i.detail.value)) : 2 == i.detail.column && (this.multiIndex[2] = i.detail.value), 
                        this.$forceUpdate();
                    },
                    getCity: function(i) {
                        var t = this;
                        this.multiArray[1] = [], this.multiArray[0][i].city.map(function(i, e) {
                            t.multiArray[1].push({
                                id: i.id,
                                name: i.name,
                                parent_id: i.parent_id,
                                district: i.district
                            });
                        }), this.getQu(0), this.$forceUpdate();
                    },
                    getQu: function(i) {
                        var t = this;
                        this.multiArray[2] = [], this.multiArray[2].length = 0, this.multiArray[1][i].district.map(function(i, e) {
                            t.multiArray[2].push({
                                id: i.id,
                                name: i.name
                            });
                        }), this.$forceUpdate();
                    }
                }
            };
            t.default = u;
        }).call(this, e("543d").default);
    }
}, [ [ "f301", "common/runtime", "common/vendor" ] ] ]);